/*
 * Copyright (c) 2016  Machine Zone, Inc.
 *
 * Original author: Lev Walkin <lwalkin@machinezone.com>
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.

 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 */
#ifndef TCPKALI_LOGGING_H
#define TCPKALI_LOGGING_H

#include "tcpkali_common.h"

enum verbosity_level {
    DBG_ALWAYS = 0,
    DBG_ERROR = 0,
    DBG_NORMAL = 1,  /* Default verbosity level */
    DBG_WARNING = 1, /* Deliberately the same as "normal" */
    DBG_DETAIL = 2,  /* Increased verbosity */
    DBG_DEBUG = 3,   /* Dump latency tables */
    _DBG_MAX
};

/*
 * Print the given string while unconditionally prepending
 * a colorized "WARNING: " prefix.
 */
void warning(const char *str, ...) PRINTFLIKE(1, 2);

void debug_log(enum verbosity_level at_verbosity,
               enum verbosity_level current_verbosity, const char *str, ...)
    PRINTFLIKE(3, 4);

#endif /* TCPKALI_LOGGING_H */
